Method for processing images and electronic device

ABSTRACT

A method for processing images is provided. The method includes: acquiring a first image by smoothing a skin region of a target object in an original image; determining a skin texture material matching with a face area of the target object; acquiring a facial texture image of the target object by rendering the skin texture material; and acquiring a second image by fusing the facial texture image with the first image.

This disclosure is based on and claims priority to Chinese PatentApplication No. 202110480567.3, filed on Apr. 30, 2021, the disclosuresof which is herein incorporated by reference in its entireties.

TECHNICAL FIELD

The present disclosure relates to the field of computer technologies,and in particular, relates to a method for processing images and anelectronic device.

BACKGROUND

With the development of computer technologies and the diversification ofterminal functions, a user can use a terminal to take selfies (namely,take his/her own portrait photos). After the selfies are taken, skingrinding can be performed on an acquired image to remove blemishes orfacial defects on a face in the image. In an ordinary face skin grindingand beautifying algorithm, the smoothness and uniformity of a face areimproved by performing high-intensity low-pass filtering on the face,thereby achieving the skin grinding effect.

SUMMARY

The present disclosure provides a method for processing images and anelectronic device. The technical solutions of the present disclosure areas follows.

According to an aspect of embodiments of the present disclosure, amethod for processing images is provided. The method includes: acquiringa first image by smoothing a skin region of a target object in anoriginal image; determining a skin texture material matching with a facearea of the target object; acquiring a facial texture image of thetarget object by rendering the skin texture material, wherein bothfacial key point information and facial posture information of thefacial texture image are matched with the target object; and acquiring asecond image by fusing the facial texture image with the first image.

According to yet another aspect of embodiments of the presentdisclosure, an electronic device is provided. The electronic deviceincludes: one or more processors; and one or more memories configured tostore one or more instructions executable by the one or more processors,wherein the one or more processors, when loading and executing the oneor more instructions, are caused to perform the following processes:acquiring a first image by smoothing a skin region of a target object inan original image; determining a skin texture material matching with aface area of the target object; acquiring a facial texture image of thetarget object by rendering the skin texture material, wherein bothfacial key point information and facial posture information of thefacial texture image are matched with the target object; and acquiring asecond image by fusing the facial texture image with the first image.

According to yet another aspect of embodiments of the presentdisclosure, a non-transitory computer-readable storage medium isprovided. The storage medium stores one or more instructions therein,wherein the one or more instructions, when loaded and executed by one ormore processors of an electronic device, causes the electronic device toperform the following processes: acquiring a first image by smoothing askin region of a target object in an original image; determining a skintexture material matching with a face area of the target object;acquiring a facial texture image of the target object by rendering theskin texture material, wherein both facial key point information andfacial posture information of the facial texture image are matched withthe target object; and acquiring a second image by fusing the facialtexture image with the first image.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a schematic diagram of an implementation environment of amethod for processing images according to an embodiment;

FIG. 2 is a flowchart of a method for processing images according to anembodiment;

FIG. 3 is a flowchart of a method for processing images according to anembodiment;

FIG. 4 is a flowchart describing a principle of a method for processingimages according to an embodiment of the present disclosure;

FIG. 5 is a logical structural block diagram of an apparatus forprocessing images according to an embodiment;

FIG. 6 is a structural block diagram of a terminal according to anembodiment of the present disclosure; and

FIG. 7 is a schematic structural diagram of an electronic deviceaccording to an embodiment of the present disclosure.

DETAILED DESCRIPTION

Terms “first,” “second,” and the like in the description and claims, aswell as the above-mentioned accompanying drawings, of the presentdisclosure are used to distinguish similar objects, but not necessarilyused to describe a specific order or precedence order. It should beunderstood that data used in this way are interchangeable whereappropriate, such that the embodiments of the present disclosuredescribed herein can be implemented in a sequence other than thoseillustrated or described herein.

User information in the present disclosure is authorized by a user orfully authorized by all parties.

The following describes terms involved in the embodiments of the presentdisclosure.

Smoothing: “Smoothing operation” and “smoothing” involved in theembodiments of the present disclosure refers to a smoothing operationperformed on an image, that is, modifying pixel values of some pixels(for example, pixels in a skin region) in a to-be-processed image, tomake the image smoother and more continuous, or reducing or deletingnoise points (or outliers) in the image. Smoothing is a process oflow-pass filtering, by which a wide area, a low-frequency component, andthe main part of an image are highlighted, and noise and ahigh-frequency interference component of the image are suppressed, suchthat the brightness of the image can change gradually, the sharpgradient can be reduced, and the quality of the image can be improved.However, edges of the image are usually blurred. A smoothing methodincludes, but is not limited to, a Gaussian blur method, a neighborhoodaveraging method (average filtering method), an overrun pixel smoothingmethod, a bilateral filtering method, a median filtering method, andsurface blur.

Gaussian blur: Gaussian blur, as an image smoothing technology, is alsoreferred to as Gaussian smoothing and is usually used to reduce imagenoise and detail level. The visual effect of the image smoothed byGaussian blur technology is like observing the image through groundglass, which is obviously different from the bokeh effect ofout-of-focus imaging of a lens and the effect of an image acquired in ageneral lighting shadow. Gaussian smoothing is also used in thepre-processing stage of a computer vision algorithm to enhance theeffects of images with different proportions. From a mathematical pointof view, the Gaussian blur process for an image is a convolution of theimage and normal distribution. Because the normal distribution is alsoreferred to as Gaussian distribution, this technology is called Gaussianblur. Blurring the image with the Gaussian blur technology produces amore accurate bokeh effect. Because the Fourier transform of a Gaussianfunction includes another Gaussian function, Gaussian blur is equivalentto a low-pass filter for an image.

Facial posture information: Facial posture information is configured toindicate a face rotation condition of a target object. In other words,the facial posture information is configured to describe angleinformation of a face orientation of the target object. Facial postureinformation is generally represented in four forms: rotation matrix,rotation vector, quaternion, and Euler angle (the four parameters canalso be converted to each other). The Euler angle is also referred to asan Euler angle of the facial posture and includes three angles, that is,pitch angle, yaw angle, and roll angle. The pitch angle indicates anangle by which a face rotates around an x-axis, and can be visuallydescribed as an angle of nodding a head; the yaw angle indicates anangle by which a face rotates around a y-axis, and can be visuallydescribed as an angle of shaking a head; and the roll angle indicates anangle by which a face rotates around a z-axis, and can be visuallydescribed as an angle of tilting/swinging a head. The embodiments of thepresent disclosure are mainly involved in the yaw angle in the Eulerangle.

Feather: A principle of feathering is to blur the connection partbetween the inside and the outside of a selected region (namely, theskin region), to achieve gradation and the effect of natural connection.“Feathering” in the embodiments of the present disclosure indicates aprocess, performed after skin grinding for the skin region using asmoothing method, for achieving an effect of natural connection on atransition part between the skin region and a non-skin region.

Scale: A scale space of a signal refers to a set of low-frequencysignals acquired by filtering an original signal via a series ofsingle-parameter Gaussian filters with increasing widths, while thescale space of an image refers to a set of low-frequency signalsacquired by replacing the foregoing original signal with image data.When analyzing an unknown scene using a machine vision system, acomputer cannot know the scale of an object in the image in advance andneeds to consider the description of the image at multiple scales toknow the best scale of an object of interest. Usually, a series of imagesets with different scales are constructed for the image, to detectfeatures of interest at different scales. For example, when detecting aface based on a Harr feature, a computer does not know the size of aface in an image. Therefore, it is necessary to generate an imagepyramid composed of a series of images of different sizes, and scan eachof the images to find a possible face. An image can be efficientlyexpressed at multiple scales by pyramiding the image. The generalprocesses of pyramiding the image include: first, the image is smoothedvia a low-pass filter; and then, the smoothed image is sampled(generally, the sampling proportion is ½ in both horizontal and verticaldirections), to acquire a series of reduced images. The term “scale”involved in the embodiments of the present disclosure refers to a scaleof texture material in the scale space. In other words, “scale”specifically refers to the resolution of the texture material.

Resolution: “Resolution” involved in the embodiments of the presentdisclosure refers to image resolution, namely, the amount of informationstored in an image, specifically, the number of pixels per inch of theimage. The unit of resolution is pixels per inch (PPI). The imageresolution is configured to indicate the definition of an image. Thegreater the resolution, the higher the definition of the image; and thesmaller the resolution, the lower the definition of the image.

In the related art, a user can use a terminal to take selfies (namely,take his/her own portrait photos). After the selfies are taken, skingrinding can be performed on an acquired image to remove blemishes orfacial defects on a human face in the image. In an ordinary face skingrinding and beautifying algorithm, the smoothness and uniformity of aface are improved by performing high-intensity low-pass filtering on theface, thereby achieving the skin grinding effect. However, this may alsodirectly cause a loss of face skin texture, which makes the sense ofunreal face stronger.

Based on the above, by performing some sharpening operations after theskin grinding, part of high-frequency information can be added back tothe image acquired after the skin grinding, to improve the reality ofportrait beautification. However, a large amount of image noises areintroduced in the case of directly performing these sharpeningoperations, which weakens the effect of removing the blemishes or facialdefects.

For example, unsharp masking (USM) is a commonly used sharpeningalgorithm, whose main idea is to acquire a high-frequency signal basedon the difference between an original image and a low-frequency signal,and then superimpose the high-frequency signal on the original imagebased on a specific weight coefficient. Because the USM sharpeningalgorithm causes an obvious edge effect, it is prone to increase imagenoise. In addition, in the case of inappropriate parameter adjustment,facial blemishes that have been removed by skin grinding are added back,resulting in low accuracy and poor effect of image processing. Inaddition, the high-frequency information is acquired based on alow-frequency signal, and all parameters required for calculating thelow-frequency signal need to be finely adjusted, such that the overallsharpening process is cumbersome and complicated.

In view of this, the embodiments of the present disclosure provide amethod for processing images, which can provide a supplement, bysuperimposing a facial texture image, for facial texture detailinformation lost during a skin grinding operation, thereby reducing thesense of unreal face caused by loss of facial texture using atraditional skin grinding method. That is, the method of the presentdisclosure can make the images going through portrait beautificationlook more real. In addition, fine processing can be further performed toa face region by locking the face region in the original image withoutaffecting other non-face regions (such as a background region, a hairregion, a hand region, and the like); and a smooth transition can beachieved between the face region and non-face regions, thereby achievinga more natural and harmonious processing effect for the beautifying ofportrait.

It should be noted that the target object involved in the embodiments ofthe present disclosure includes but is not limited to a character, ananimal, a cartoon character, a virtual character, a virtual object, orthe like. The type of the target object is not specifically limited inthe embodiments of the present disclosure.

FIG. 1 is a schematic diagram of an implementation environment of amethod for processing images according to an embodiment. Referring toFIG. 1, the implementation environment includes a terminal 101 and aserver 102. Each of the terminal 101 and the server 102 is an electronicdevice. The following provides detailed descriptions.

The terminal 101 is any electronic device supporting image processing,on which an application for processing images is installed. For example,the application includes at least one of a retouching application, aphoto-taking application, a short video application, a live-streamingapplication, or a social application. Execution code used for processingimages is embedded in the application. In this way, in response to auser inputting an original image containing a target object into theapplication, the following processes are performed based on theexecution code: Smoothing is performed on the skin region of the targetobject; after the skin grinding effect is achieved, skin texture detailsof the target object are added, based on a pre-stored skin texturematerial, to a first image acquired by grinding the skin. Therefore, thesense of the unreal face caused by the skin grinding operation isweakened, and the reality/authenticity of portrait beautification isimproved.

The terminal 101 and the server 102 is connected with each other via awired or wireless network.

The server 102 is an electronic device configured to provide backgroundservices for the above application. The server 102 includes at least oneof one server, a plurality of servers, a cloud computing platform, or avirtual center. Optionally, the server 102 is responsible for theprimary work of image processing, and the terminal 101 is responsiblefor the secondary work of image processing; or the server 102 isresponsible for the secondary work of image processing, and the terminal101 is responsible for the primary work of image processing; or adistributed computing architecture is used between the terminal 101 andthe server 102 to perform the image processing collaboratively.

In some embodiments, the terminal 101 performs the method for processingimages independently, which can reduce the computing load of the server102 and avoid occupying processing resources of the server 102 duringimage processing.

In some embodiments, the terminal 101 cooperates with the server 102 toperform the method for processing images via information interactionbetween the terminal 101 and the server 102. In other words, afteracquiring the original image, the terminal 101 sends a skin grinding andbeautifying instruction containing the original image to the server 102in response to a trigger operation of a user for a skin grindingfunctional option. In response to the skin grinding and beautifyinginstruction, the server 102 acquires a second image by smoothing theoriginal image and then superimposing a skin texture material on thesmoothed image, and finally sends the second image to the terminal 101.In this case, some image processing work can be migrated to the server102, thereby maintaining relatively high system performance of theterminal.

In some embodiments, the terminal 101 refers to one of a plurality ofterminals. A device type of the terminal 101 may be, but not limited to,at least one of a vehicle terminal, a television, a smart phone, a smartspeaker, a tablet computer, an e-book reader, a Moving Picture ExpertsGroup Audio Layer III (MP3) player, a Moving Picture Experts Group AudioLayer IV (MP4) player, a laptop portable computer, or a desktopcomputer. The following embodiments are described by using an example inwhich the terminal includes a smart phone.

Those skilled in the art can know that a quantity of the terminals 101can be greater or less. For example, there is only one, or are tens of,hundreds of, or a greater quantity of the terminals 101. The quantityand device type of the terminals 101 are not limited in the embodimentsof the present disclosure.

FIG. 2 is a flowchart of a method for processing images according to anembodiment. Referring to FIG. 2, the method for processing images isexecuted by an electronic device.

In 201, a first image is acquired by smoothing a skin region of a targetobject contained in an original image. In other words, the first imageis acquired by smoothing the skin region of the target object in theoriginal image.

In 202, a skin texture material corresponding to a face area of thetarget object is determined based on the face area. In other words, theskin texture material matching with the face area of the target objectis determined.

In 203, a facial texture image corresponding to the target object isacquired by rendering the skin texture material, wherein both facial keypoint information and facial posture information of the facial textureimage are matched with the target object. The facial texture imagecorresponding to the target object is a facial texture image of thetarget object.

In 204, a second image is acquired by fusing the facial texture imagewith the first image.

In the method provided by the embodiment of the present disclosure,after smoothing the skin region of the target object in the originalimage, the skin texture material whose scale matches the face area isselected to generate the facial texture image that changes depending ona facial posture of the target object. The facial texture image issuperimposed on the smoothed first image, such that the finally acquiredsecond image has a better face skin grinding effect, and more facialtexture details are restored, thereby improving the image processingaccuracy and the image processing effect.

In some embodiments, determining the skin texture material matching withthe face area of the target object includes: determining, based on aface area range within which the face area is, a resolution rangematching with the face area range, wherein a median value of the facearea range is positively correlated with a median value of theresolution range; and acquiring the skin texture material whoseresolution is within the resolution range.

In some embodiments, acquiring the facial texture image matching withthe target object by rendering the skin texture material includes:acquiring the facial key point information and the facial postureinformation of the target object, wherein the facial posture informationis configured to indicate a face rotation condition of the targetobject; acquiring a target texture material by rendering the skintexture material based on the facial key point information and thefacial posture information of the target object; and acquiring thefacial texture image by fusing the target texture material with theoriginal image.

In some embodiments, acquiring the target texture material by renderingthe skin texture material based on the facial key point information andthe facial posture information of the target object includes: acquiringstandard key point information of the skin texture material;determining, based on the facial key point information and the standardkey point information, a correspondence relationship between standardkey points of the skin texture material and facial key points of thetarget object; and acquiring the target texture material by performingtexture mapping on the skin texture material based on the correspondencerelationship and the facial posture information.

In some embodiments, acquiring the first image by smoothing the skinregion of the target object in the original image includes: acquiringfacial key point information and facial posture information of thetarget object, wherein the facial posture information of the targetobject is configured to indicate a face rotation condition of the targetobject; acquiring a posture weight image of the target object based onthe facial posture information of the target object, wherein the pixelvalue of each pixel in the posture weight image is configured toindicate a posture weight parameter of a corresponding pixel in theoriginal image, the posture weight parameter being configured toindicate an importance of the corresponding pixel relative to the facialposture information; and acquiring the first image by smoothing the skinregion based on the posture weight image.

In some embodiments, the facial posture information includes an Eulerangle of the facial posture of the target object, and acquiring theposture weight image of the target object based on the facial postureinformation of the target object includes: acquiring a face orientationmask map of the target object based on a value symbol of the Euler angleof the facial posture, wherein the face orientation mask map isconfigured to indicate whether an orientation of a face of the targetobject is forward or backward; acquiring a distance from each pixel in aface region of the target object to a face midline; and acquiring theposture weight image based on the face orientation mask map and thedistance.

In some embodiments, acquiring the posture weight image based on theface orientation mask map and the distance includes: acquiring a firstvalue by multiplying the distance for each pixel in the face region ofthe target object by a pixel value of a corresponding pixel in the faceorientation mask map; acquiring a second value by multiplying the firstvalue by a first coefficient, wherein the first coefficient is anadjustment factor for a distance from a pixel to a face midline, and isgreater than or equal to 0 and less than or equal to 1; and acquiringthe pixel value of a corresponding pixel in the posture weight image bycalculating a difference between a second coefficient and the secondvalue, wherein the second coefficient is equal to 1.

In some embodiments, acquiring the first image by smoothing the skinregion based on the posture weight image includes: acquiring a skinregion image of the original image, wherein the skin region image isconfigured to indicate the skin region of the target object in theoriginal image; acquiring a smoothed skin tone image and a smoothedposture weight image by smoothing the skin region image and the postureweight image based on a two-dimensional Gaussian blur function; andacquiring the first image by fusing the original image with the smoothedskin tone image and the smoothed posture weight image.

In some embodiments, the method further includes: acquiring a hairregion image and an occluded face region image of the original image,and an average brightness parameter of the face region of the targetobject in the original image, wherein the hair region image isconfigured to indicate a hair region of the target object in theoriginal image, and the occluded face region image is configured toindicate an occluded face region of the target object in the originalimage; and acquiring the second image by fusing the facial texture imagewith the first image includes: acquiring the second image based on thehair region image, the occluded face region image, the first image, thefacial texture image, and the average brightness parameter.

In some embodiments, acquiring the second image based on the hair regionimage, the occluded face region image, the first image, the facialtexture image, and the average brightness parameter includes: acquiringa third image by multiplying the pixel value of a pixel in the hairregion image by the pixel values of pixels at corresponding positions inthe occluded face region image, the first image, and the facial textureimage; and acquiring the second image by multiplying the pixel value ofeach pixel in the third image by the average brightness parameter.

FIG. 3 is a flowchart of a method for processing images according to anembodiment. Referring to FIG. 3, the method for processing images isexecuted by an electronic device, and the following is taken theelectronic device as a terminal as an example for description.

In 301, a terminal acquires an original image containing a targetobject.

The terminal is any electronic device supporting image processing. Anapplication used for processing images is installed on the terminal. Forexample, the application includes at least one of a retouchingapplication, a photo-taking application, a short video application, alive-streaming application, or a social application.

In some embodiments, the original image is a portrait photo taken by acamera component invoked by the terminal. For example, a user triggers ashooting instruction in the application. In response to the shootinginstruction, the operating system of the terminal invokes the cameracomponent to acquire an original image. Alternatively, the originalimage is a face image read by the terminal from a local database or aface image loaded by the terminal from a cloud database, the acquiringmanner of which is not specifically limited in the embodiments of thepresent disclosure.

In some embodiments, the original image is any frame of image in a video(that is, a video frame) stored in the local database of the terminal,or the original image is any frame of image in a video loaded by theterminal from the cloud database. Whether the original image is a videoframe is not specifically limited in the embodiments of the presentdisclosure.

This embodiment of the present disclosure is described by using anexample in which the target object is a character and the original imageis a portrait. In some other embodiments, the target object includes ananimal (for example, a cat or a dog), a cartoon character, a virtualcharacter, a virtual object, or the like. The type of the target objectis not specifically limited in the embodiments of the presentdisclosure.

In some embodiments, in the case that the user determines that theshooting or selection of the original image is completed, the user cantrigger an image processing instruction, such that the terminal performsthe following 302 in response to the image processing instruction. Insome embodiments, the image processing instruction carries the originalimage. In some embodiments, the image processing instruction istriggered via a skin grinding functional option in the application. Thetriggering mode for the image processing instruction includes a tapoperation, a double-tap operation, a long press operation, and a dragoperation in a specified direction, which is not specifically limited inthe embodiments of the present disclosure.

In some embodiments, in the case that the user starts a photo-takingapplication on the terminal and taps a photo-taking functional option,the terminal invokes the camera component to take an original image,displays the original image in the photo-taking application, andprovides at least one beautifying functional option for the originalimage, such as a skin grinding functional option, a face-lift functionaloption, a makeup functional option, a filter functional option, asticker functional option, and a magic emoticon functional option. Inresponse to the user tapping the skin grinding functional option, theimage processing instruction is triggered, and the following 302 isperformed.

In 302, the terminal acquires a hair region image, an occluded faceregion image, and a skin region image of the original image in responseto the image processing instruction for the original image.

The hair region image is configured to indicate the hair region of thetarget object in the original image.

In some embodiments, the hair region image is a digital matrix havingthe same size as the original image. Each element in the matrixrepresents the probability that a pixel at a corresponding position inthe original image belongs to the hair region. In this case, the hairregion image is also referred to as a hair probability image. Becausethe hair region image has the same size as the original image, for anyelement in the matrix, a pixel having same position coordinates as theelement can be determined in the original image according to theposition coordinates of the element. The pixel having the samecoordinates as the element is the above-mentioned pixel at thecorresponding position. In some embodiments, only the probability ofbinarization is used in the above digital matrix, accordingly, the hairregion image is a binary image. For example, in the binary image, apixel whose value is 1 belongs to the hair region, and a pixel whosevalue is 0 belongs to a non-hair region; or a pixel whose value is 1belongs to a non-hair region, and a pixel whose value is 0 belongs tothe hair region, which is not specifically limited in the embodiments ofthe present disclosure.

In some embodiments, the terminal extracts the hair region image using adeep neural network. For example, the terminal inputs the original imageinto the deep neural network, the original image is weighted via aplurality of hidden layers connected in series in the deep neuralnetwork, and the hair region image is output from a last hidden layer.The deep neural network (DNN) includes a visual geometry group network(VGGNet), a residual neural network (ResNet), or the like, the structureof which is not limited in the embodiments of the present disclosure.

The occluded face region image is configured to indicate an occludedface region of the target object in the original image.

In some embodiments, the occluded face region image is a digital matrixhaving the same size as the original image. Each element in the matrixrepresents the probability that a pixel at a corresponding position inthe original image belongs to the face region and is occluded. In thiscase, the occluded face region image is also referred to as an occludedface probability image. Because the occluded face region image has thesame size as the original image, for any element in the matrix, a pixelhaving same position coordinates as the element can be determined in theoriginal image according to the position coordinates of the element. Thepixel having the same coordinates as the element is the above-mentionedpixel at the corresponding position. In some embodiments, only theprobability of binarization is used in the above digital matrix,accordingly, the occluded face region image is a binary image. Forexample, in the binary image, a pixel whose value is 1 belongs to theoccluded face region, and a pixel whose value is 0 does not belong tothe occluded face region; or a pixel whose value is 1 does not belong tothe occluded face region, and a pixel whose value is 0 belongs to theoccluded face region, which is not specifically limited in theembodiments of the present disclosure.

In some embodiments, the terminal extracts the occluded face regionimage using a deep neural network. For example, the terminal inputs theoriginal image into the deep neural network, the original image isweighted via a plurality of hidden layers connected in series in thedeep neural network, and the occluded face region image is output from alast hidden layer. The deep neural network (DNN) includes a VGGNet, aResNet, or the like, the structure of which is not limited in theembodiments of the present disclosure.

The skin region image is configured to indicate the skin region of thetarget object in the original image.

In some embodiments, the skin region image is a digital matrix havingthe same size as the original image. Each element in the matrixrepresents the probability that a pixel at a corresponding position inthe original image belongs to the skin region. In this case, the skinregion image is also referred to as a skin tone probability image.Because the skin region image has the same size as the original image,for any element in the matrix, a pixel having same position coordinatesas the element can be determined in the original image according to theposition coordinates of the element. The pixel having the samecoordinates as the element is the above-mentioned pixel at thecorresponding position. In some embodiments, only the probability ofbinarization is used in the above digital matrix, accordingly, the skinregion image is a binary image. For example, in the binary image, apixel whose value is 1 belongs to the skin region, and a pixel whosevalue is 0 belongs to a non-skin region; or a pixel whose value is 1belongs to a non-skin region, and a pixel whose value is 0 belongs tothe skin region, which is not specifically limited in the embodiments ofthe present disclosure.

In some embodiments, the terminal extracts the skin region image using adeep neural network. For example, the terminal inputs the original imageinto the deep neural network, the original image is weighted via aplurality of hidden layers connected in series in the deep neuralnetwork, and the skin region image is output from a last hidden layer.The deep neural network (DNN) includes a VGGNet, a ResNet, or the like,the structure of which is not limited in the embodiments of the presentdisclosure.

In some embodiments, the above deep neural networks for extracting thehair region image, the occluded face region image, and the skin regionimage are an entire deep neural network or three different deep neuralnetworks. In the case that the above deep neural networks are the entiredeep neural network, in response to the original image being input, theentire deep neural network outputs the above three images: the hairregion image, the occluded face region image, and the skin region image,such that the image processing process can be simplified. In the casethat the above deep neural networks are three different deep neuralnetworks, the three different deep neural networks are respectivelyconfigured to extract and acquire different region images independently,such that the pertinence for extracting and acquiring each region imagecan be strengthened. This is not specifically limited in the embodimentsof the present disclosure.

In some embodiments, the above entire deep neural network is a semanticsegmentation model. In response to the terminal inputting the originalimage into the semantic segmentation model, the semantic segmentationmodel performs semantic segmentation on the original image, identifiesthe hair region, the occluded face region, and the skin region in theoriginal image, and outputs the corresponding hair region image,occluded face region image, and skin region image. In some embodiments,the semantic segmentation model includes a fully convolutional network(FCN), a U-shaped convolutional neural network (U-net), a semanticsegmentation network (SegNet), a linkage network (LinkNet), or the like.The structure of the semantic segmentation model is not specificallylimited in the embodiments of the present disclosure.

In 303, the terminal acquires facial key point information and facialposture information of the target object.

The facial key point information is configured to indicatethree-dimensional spatial coordinates of each facial key point of thetarget object. In some embodiment, the number of the facial key pointsis any value greater than 0. For example, the number of the facial keypoints is 5, 68, 128, or the like. The number of the facial key pointsis not specifically limited in the embodiments of the presentdisclosure.

The facial posture information is configured to indicate a face rotationcondition of the target object. In other words, the facial postureinformation is configured to describe angle information of a faceorientation of the target object. In some embodiments, the facialposture information includes at least one of a rotation matrix, arotation vector, a quaternion, or an Euler angle of the facial posture,which is not specifically limited in the embodiments of the presentdisclosure.

In some embodiments, the terminal acquires a facial key point image bydetecting facial key points from the original image, and acquiresthree-dimensional spatial coordinates of each facial key point (namely,the facial key point information) by converting two-dimensional imagecoordinates of each facial key point in the facial key point image froma pixel coordinate system to a world coordinate system. Optionally,during the process of acquiring the above facial key point information,a rotation matrix of a facial posture is also obtained. Based on therotation matrix, the Euler angle of the facial posture (namely, thefacial posture information) can be acquired via conversion.

In the above process, acquiring the facial key point information and thefacial posture information is equivalent to acquiring the spatialcoordinate information of the face, and it is convenient to calculatethe face area based on the facial key point information and generate aposture weight image based on the facial posture information, therebyfacilitating the overall image processing process.

In some embodiments, the terminal may extract the facial key pointinformation and the facial posture information using a deep neuralnetwork. For example, the terminal inputs the original image into thedeep neural network, the original image is weighted via a plurality ofhidden layers connected in series in the deep neural network, the facialkey point image is output from a last hidden layer, and the facial keypoint information and the facial posture information are acquired bypost-processing based on the facial key point image.

In some embodiments, the deep neural network includes a deepconvolutional neural network (DCNN) model, a tasks-constrained deepconvolutional network (TCDCN), a multi-task cascaded convolutionalneural network (MTCNN), or the like, the structure of which is notlimited in the embodiments of the present disclosure.

In some embodiments, the terminal detects facial key points by using afacial key point detection algorithm, such that the facial key pointdetection process can be simplified. For example, the facial key pointdetection algorithm includes active shape models (ASM), activeappearance models (AAM), cascaded pose regression (CPR), and the like,and the type of the facial key point detection algorithm is notspecifically limited in the embodiments of the present disclosure. Afterthe two-dimensional image coordinates of each facial key point aredetected based on the above facial key point detection algorithm, thethree-dimensional spatial coordinates of each facial key point (namely,the facial key point information) can be acquired by converting thetwo-dimensional image coordinates from the pixel coordinate system tothe world coordinate system. In addition, the Euler angle of the facialposture (namely, the facial posture information) can be acquired basedon the rotation matrix of the facial posture.

In 304, the terminal acquires a posture weight image of the originalimage based on the facial posture information.

The pixel value of each pixel in the posture weight image is configuredto indicate a posture weight parameter of a corresponding pixel in theoriginal image. The posture weight parameter is configured to indicatethe importance of the corresponding pixel relative to the facial postureinformation. It should be noted that the corresponding pixel means thatfor any pixel in the posture weight image, a pixel having same positioncoordinates as the pixel in the posture weight image can be determinedin the original image according to the position coordinates of the pixelin the posture weight image, wherein the pixel having the samecoordinates as the pixel in the posture weight image is theabove-mentioned corresponding pixel.

In some embodiments, description is given by taking the facial postureinformation as an Euler angle of the facial posture of the target objectas an example. The terminal acquires a face orientation mask map of thetarget object based on a value symbol of the Euler angle of the facialposture, wherein the face orientation mask map is configured to indicatewhether an orientation of a face in the target object is forward orbackward; acquire a distance from each pixel in the face region of thetarget object to a face midline; and acquire the posture weight imagebased on the face orientation mask map and the distance.

The Euler angle of the facial posture is referred to as Euler angle forshort, and includes three angles, that is, pitch angle, yaw angle, androll angle. The pitch angle indicates an angle by which a face rotatesaround an x-axis, and can be visually described as an angle of nodding ahead; the yaw angle indicates an angle by which a face rotates around ay-axis, and can be visually described as an angle of shaking ahead; andthe roll angle indicates an angle by which a face rotates around az-axis, and can be visually described as an angle of tilting/swinging ahead.

In some embodiments, only the yaw angle in the Euler angle of the facialposture is considered. The value of the yaw angle is an angle value witha symbol. Whether the value symbol is positive or negative indicateswhether the face orientation of the target object is forward orbackward. In some embodiments, the value of the yaw angle being positiveindicates that the face orientation is forward, and the value beingnegative indicates that the face orientation is backward. In someembodiments, the value of the yaw angle being positive indicates thatthe face orientation is backward, and the value being negative indicatesthat the face orientation is forward, which is not specifically limitedin the embodiments of the present disclosure.

Assuming that the value of the yaw angle being positive indicates thatthe face orientation is forward, and the value being negative indicatesthat the face orientation is backward, after the terminal acquires theyaw angle in the Euler angle of the facial posture, in the case that theyaw angle is greater than or equal to 0, it indicates that the valuesymbol of the yaw angle is “+” (that is, the value is positive) and thatthe face orientation of the target object is forward. In this case, thepixel value of each pixel in the face orientation mask map is set to 1.On the contrary, in the case that the yaw angle is less than 0, itindicates that the value symbol of the yaw angle is “−” (that is, thevalue is negative) and that the face orientation of the target object isbackward. In this case, the pixel value of each pixel in the faceorientation mask map is set to 0.

In some embodiments, during the process of acquiring the distance fromeach pixel to the face midline, the terminal determines a facial keypoint at a tip of a nose and a facial key point at a root of the nose(or a facial key point at a lower jaw) from all facial key points, anddetermine a straight line as the face midline based on the two facialkey points. Further, for each pixel, a directional distance with asymbol is acquired by multiplying the distance (the distance from apoint to a line) from each pixel to the face midline by the yaw angle.

In some embodiments, during the process of acquiring the posture weightimage, the terminal weights the face orientation mask map with the abovedistance. In other words, for each pixel in the face region, a firstvalue is acquired by multiplying the distance from the pixel to the facemidline by the pixel value of a corresponding pixel in the faceorientation mask map; a second value is acquired by multiplying thefirst value by a first coefficient β, wherein the first coefficient β isan adjustment factor for the distance from a pixel to the face midline,and is greater than or equal to 0 and less than or equal to 1; and thepixel value of a corresponding pixel in the posture weight image isacquired by calculating the difference between a second coefficient αand the second value, wherein the second coefficient α is equal to 1. Itshould be noted that the corresponding pixel means that because the faceorientation mask map can indicate the face orientation of each pixel inthe face region of the target object, for any pixel in the face region,a pixel configured to indicate the face orientation of the pixel in theface region can be determined in the face orientation mask map (that is,the corresponding pixel).

In the above process, the face orientation mask map is weighted based onthe distance from each pixel to the face midline, such that the value ofeach pixel in the posture weight image contains richer information, thatis, the value can indicate not only whether the face orientation isforward or backward, but also whether the pixel is close to the centerof the face or close to an edge of the face. Therefore, the postureweight image has a higher expression capability. In some embodiments,the terminal skips the process of weighting the face orientation maskmap, that is, the face orientation mask map is directly used as theposture weight image, such that the image processing process can besimplified.

For example, assuming that the face orientation mask map is representedas m_(faceD), and the distance from each pixel to the face midline isrepresented as l, the posture weight image is represented asP_(f)=α−β·l·m_(faceD) wherein the second coefficient α is equal to 1,and the first coefficient β is an adjustable empirical parameter.

In the above process, an example in which the facial posture informationis the Euler angle of the facial posture of the target object is takenfor describing a process of acquiring the posture weight image. In thecase that the Euler angle of the facial posture is used as the facialposture information, the posture weight image can be acquired faster andmore conveniently. In addition, considering the yaw angle in the Eulerangle of the facial posture can simplify the image processing processand reduce the computing load of the terminal.

In some embodiments, the values of the three angles in the Euler angleof the facial posture can also be comprehensively considered by theterminal, such that different posture weight parameters can be setrespectively for six different face orientations (forward, backward,leftward, rightward, upward, and downward), to further improve the imageprocessing precision.

In some embodiments, in addition to the Euler angle of the facialposture, the facial posture information further includes a rotationmatrix, a rotation vector, a quaternion, or the like, expression mode ofwhich is not specifically limited in the embodiments of the presentdisclosure.

In 305, the terminal acquires a smoothed skin tone image and a smoothedposture weight image by smoothing the skin region image and the postureweight image based on a two-dimensional Gaussian blur function.

In some embodiments, the terminal smooths any pixel (x, y) in the skinregion image or the posture weight image based on the two-dimensionalGaussian blur function. The expression of the two-dimensional Gaussianblur function G_((x,y)) is as follows:

$G_{({x,y})} = {\frac{1}{2\pi\sigma^{2}}e^{{{- {({x^{2} + y^{2}})}}/2}\sigma^{2}}}$

wherein σ represents a standard deviation of Gaussian distribution, xrepresents an abscissa of a pixel, y represents an ordinate of a pixel,e represents the base of the natural logarithm, and π represents PI.

In some embodiments, taking the skin region image as an example,Gaussian blurring is equivalent to transforming the skin region image bya convolution matrix composed of pixels whose distribution is not zero.The pixel value of each pixel in the smoothed skin tone image is theweighted average value of the values of surrounding adjacent pixels of apixel at a corresponding position in the skin region image. Duringweighted averaging, the closer a pixel is to the pixel at thecorresponding position, the greater the weight is, and the farther thepixel is away from the pixel at the corresponding position, the smallerthe weight is. The way of Gaussian blurring for the posture weight imageis similar to the way of Gaussian blurring for the skin region image,which is not repeated in detail herein.

In the above process, the terminal can achieve the feathering effect forthe skin region image and the posture weight image via two-dimensionalGaussian blurring by smoothing the skin region image and the postureweight image, thereby achieving a smoother transition effect. Gaussianblurring has the advantages of high calculation efficiency, fastcalculation speed, and the like.

In some embodiments, the terminal acquires the smoothed skin tone imageand the smoothed posture weight image by smoothing the skin region imageand the posture weight image using a neighborhood averaging method(average filtering method), an overrun pixel smoothing method, anedge-preserving filtering method, a median filtering method, aconvolution method, or other smoothing methods, and the smoothing methodis not specifically limited in the embodiments of the presentdisclosure.

In 306, the terminal acquires a face area of the target object and anaverage brightness parameter of the face region of the target objectbased on the facial key point information.

In some embodiments, the terminal may determine a face outline of thetarget object in the original image based on the facial key pointinformation, and acquire an area surrounded by the face outline as theface area. Alternatively, the terminal may directly acquire an area, ofthe face skin region in the skin region indicated by the skin regionimage in the above 302, as the face area.

In some embodiments, after determining the face region in the originalimage, the terminal extracts the brightness value of each pixel in theface region, and acquires the average value of the brightness values ofall the pixels as the average brightness parameter.

In 307, the terminal determines a skin texture material corresponding tothe face area based on the face area of the target object.

The above 307 means that the terminal determines the skin texturematerial matching with the face area of the target object.

In some embodiments, the terminal pre-stores at least one candidate skintexture material, and randomly selects one of the pre-stored skintexture materials as the skin texture material matching with the facearea, wherein these skin texture materials are texture materials forstandard skin of the face of a character drawn by a technician. In thisway, the acquisition process of the skin texture material can besimplified.

In some embodiments, the skin texture materials have different levels ofresolutions (namely, scales). The terminal determines, based on a facearea range within which the face area acquired in the above 306 is, aresolution range matching with the face area range, wherein the medianof the face area range is positively correlated with the median of theresolution range; and acquire the skin texture material whose resolutionis within the resolution range.

In the above process, it is equivalent to classifying, based ondifferent resolution values, all the pre-stored skin texture materialsinto material sets corresponding to different resolution ranges. Inaddition, each resolution range matches with one face area range. It canbe ensured that the greater the median of a resolution range, thegreater the median of a matching face area range. In this case, theresolution range, matching with a face area range within which the facearea of the target object is, can be determined based on the face arearange, and then a skin texture material can be randomly selected from amaterial set of the resolution range. Therefore, the skin texturematerial whose resolution and size better match the face area can beselected based on different sizes of the face area of the target object,which makes a facial texture image sequentially acquired via renderingmore natural and reduces the sense of inharmoniousness.

In some embodiments, the terminal determines a first skin texturematerial in response to the face area being greater than a first areathreshold; determines a second skin texture material in response to theface area being less than or equal to the first area threshold andgreater than a second area threshold, wherein the resolution of thesecond skin texture material is less than the resolution of the firstskin texture material; and determines a third skin texture material inresponse to the face area being less than or equal to the second areathreshold, wherein the resolution of the third skin texture material isless than the resolution of the second skin texture material.

Both the first area threshold and the second area threshold are valuesgreater than 0, and the first area threshold is greater than the secondarea threshold.

In some embodiments, the skin texture materials are classified intothree scales depending on different resolutions. The resolution of askin texture material in a first scale is greater than a firstresolution threshold, that is, a skin texture material matching with thefirst scale is referred to as the first skin texture material; theresolution of a skin texture material in a second scale is less than orequal to the first resolution threshold and is greater than a secondresolution threshold, that is, a skin texture material matching with thesecond scale is referred to as the second skin texture material; and theresolution of a skin texture material in a third scale is less than orequal to the second resolution threshold, that is, a skin texturematerial matching with the third scale is referred to as the third skintexture material. Both the first resolution threshold and the secondresolution threshold are values greater than 0, and the first resolutionthreshold is greater than the second resolution threshold.

In some embodiments, when selecting one of skin texture materials withina same scale, the terminal randomly selects one skin texture materialfrom all skin texture materials within this scale; or the terminalacquires the attribute information of the target object, and selects theskin texture material matching with the attribute information from allthe skin texture materials in this scale. Optionally, the attributeinformation may include, but is not limited to, gender, age, and race.

In some embodiments, taking that the attribute information is gender asan example, the gender of the target object may be extracted via abinary classification model, such as a logistic regression model, thatis, the original image is input into the logistic regression model, andthe probability that “the target object is male” is predicted via thelogistic regression model. In the case that the probability output bythe logistic regression model is greater than a predetermined threshold,it is determined that the gender of the target object is male;otherwise, in the case that the probability output by the model is lessthan or equal to the predetermined threshold, it is determined that thegender of the target object is female, wherein the predeterminedthreshold is any value great than or equal to 0 and less than or equalto 1. Similarly, all other attribute information such as age and race ofthe target object can be extracted via a binary classification model ora multi-class classification model. The acquiring method for theattribute information is not specifically limited in the embodiments ofthe present disclosure.

In some embodiments, taking that the attribute information is gender asan example, skin texture materials in each scale include a male skintexture material and a female skin texture material. After the matchingresolution range (namely, resolution scale) is selected based on theface area range within which the face area of the target object is, theskin texture material is selected based on the attribute information ofthe target object. In the case that the attribute information of thetarget object is male, a male skin texture material is selected fromskin texture materials in the matching resolution scale.

In some embodiments, assuming that the first area threshold is T₁, thesecond area threshold is T₂, the face area is A_(f), and the terminalpre-stores three skin texture materials S₁, S₂, and S₃ with differentscales, the terminal performs the following operations: in the case thatA_(f)>T₁, the skin texture material S₁ with the greatest scale isselected; in the case that T₁≥A_(f)γT₂, the skin texture material S₂with the moderate scale is selected; and in the case that A_(f)≤T₂, theskin texture material S₃ with the smallest scale is selected.

In the above process, the skin texture materials are classified intodifferent levels based on resolutions, and correspondences between thedifferent levels and different face area ranges are established, suchthat faces with different sizes and resolutions of the target object canbe targeted to select skin texture materials with different scales, anda facial texture image sequentially acquired via rendering can betterfit the target object.

In 308, the terminal acquires a facial texture image corresponding tothe target object by rendering the skin texture material.

The above 308 means that the terminal acquires the facial texture imageof the target object by rendering the skin texture material.

Both facial key point information and facial posture information of thefacial texture image are matched with the target object.

In some embodiments, the terminal acquires a target texture material byrendering the skin texture material based on the facial key pointinformation and the facial posture information of the target object; andacquires the facial texture image by fusing the target texture materialwith the original image.

In the above process, the skin texture material is rendered based on thespatial coordinate information of the face, to acquire the renderedtarget texture material. Therefore, an original standard skin texturematerial can be changed into the target texture material that fits thefacial features and posture of the target object, that is, the targettexture material has better fitness. Further, skin texture materials ofdifferent scales are selected for face areas of different sizes toachieve hierarchical rendering, such that on the basis that the targettexture material fits the facial features and posture of the targetobject, it can also be ensured that the target texture material betterfits the size and resolution of the face of the target object.Therefore, the above target texture material is also referred to as“face follow-up texture image.”

In some embodiments, when rendering the skin texture material, theterminal acquires standard key point information of the skin texturematerial; determine a correspondence relationship between standard keypoints of the skin texture material and facial key points of the targetobject based on the facial key point information and the standard keypoint information; and acquire the target texture material by performingtexture UV mapping on the skin texture material based on thecorrespondence relationship and the facial posture information. Thefacial key point information is configured to indicate the facial keypoints of the target object, and the standard key point information isconfigured to indicate the standard key points of the skin texturematerial.

In the above process, because key points at a corresponding position ofthe face have a same index number in the facial key point informationand the standard key point information, correspondences relationshipbetween the standard key points of the skin texture material and thefacial key points of the target object can be established based on indexnumbers. Further, UV mapping can be precisely performed on a skintexture material of a standard posture based on the correspondencerelationship and the facial posture information configured to indicate aface rotation condition, thereby forming a target texture material thatmatches the facial key point information and the facial postureinformation of the target object. Therefore, the target texture materialcan be more natural, and can avoid the sense of discomfort and thefeeling of inharmoniousness caused due to an unconformity between afacial texture direction of the target texture material and a posture ora facial key point of the target object.

In some embodiments, the terminal fuses the target texture material withthe original image by performing fusion in a linear light superpositionmode. For example, assuming that the original image is I, and the targettexture material is T_(s), the facial texture image I_(t) is representedas I_(t)=I+2.0×T_(s)−1.0, such that the target texture material and theoriginal image is better fused.

In some embodiments, besides the above-mentioned fusion in the linearlight superposition mode, the terminal acquires the facial texture imageby directly adding pixels in the target texture material with pixels atcorresponding positions in the original image by element, such thatcomputing resources of the terminal can be saved.

In 309, the terminal acquires a second image based on the originalimage, the hair region image, the occluded face region image, thesmoothed skin tone image, the smoothed posture weight image, the facialtexture image, and the average brightness parameter.

In some embodiments, the terminal expands the average brightnessparameter acquired in the above 306 into a brightness image having thesame size as the original image, the value of each pixel in thebrightness image being the average brightness parameter; and acquire thesecond image by performing multiplication on the pixel values of pixelsat corresponding positions in the above seven images having the samesize, that is, the brightness image, the original image acquired in theabove 301, the hair region image and the occluded face region imageacquired in the above 302, the smoothed skin tone image and the smoothedposture weight image acquired in the above 305, and the facial textureimage acquired in the above 308.

In some embodiments, without considering the hair region image, theoccluded face region image, and the average brightness parameter, theterminal acquires the first image by fusing the original image, thesmoothed skin tone image, and the smoothed posture weight image, andthen acquires the second image by fusing the facial texture image withthe first image, such that the image processing process can besimplified.

In some embodiments, a server fuses the original image, the smoothedskin tone image, and the smoothed posture weight image in the followingway: acquiring the first image by multiplying a pixel value of a pixelin the original image by pixel values of pixels at correspondingpositions in the smoothed skin tone image and the smoothed postureweight image by element.

In some embodiments, the server fuses the facial texture image with thefirst image in the following way: acquiring the second image bymultiplying a pixel value of a pixel in the first image by a pixel valueof a pixel at a corresponding position in the facial texture image byelement.

The above process for acquiring the first image is a process ofacquiring the first image by the terminal by smoothing the skin regionbased on the posture weight image. By introducing the posture weightimage during acquiring the first image, the distance between each facepixel and the face midline and the orientation of each face pixel isconsidered during smoothing of the skin region, such that a bettersmoothing effect can be achieved.

In some embodiments, in addition to introducing a posture weightingmechanism by using the posture weight image, the terminal can alsoacquire, using another smoothing fashion, the first image by smoothingthe skin region of the target object in the original image containingthe target object. For example, the above smoothing method includes, butis not limited to, a neighborhood averaging method (average filteringmethod), an overrun pixel smoothing method, an edge-preserving filteringmethod, a median filtering method, and a convolution method, which isnot specifically limited in the embodiments of the present disclosure.

In some embodiments, in the cast that the hair region image, theoccluded face region image, and the average brightness parameter areconsidered, the above 308 is equivalent to acquiring the second imagebased on the hair region image, the occluded face region image, thefirst image, the facial texture image, and the average brightnessparameter.

In some embodiments, the terminal performs the following processes:acquiring a third image by multiplying the pixel value of a pixel in thehair region image by the pixel values of pixels at correspondingpositions in the occluded face region image, the first image, and thefacial texture image; and acquiring the second image by multiplying thepixel value of each pixel in the third image by the average brightnessparameter. Therefore, the above images can be fully fused without losingthe important information of the average brightness parameter.

In the above process, factors such as the hair region image, theoccluded face region image, and the average brightness parameter areintroduced during acquiring of the second image, such that texturedetails are not added to the hair region and the occluded face region inthe second image, that is, texture details are only added to a face skinregion that is smoothed and not occluded. Therefore, a deformationoccurred in the hair region or a deformation occurred in the occludedface region in the second image is avoided; and it is ensured that addedtexture details conform with the original average brightness parameterof the face, which can avoid inconsistency of skin tones in the secondimage.

FIG. 4 is a flowchart describing a principle of a method for processingimages according to an embodiment of the present disclosure. Referringto FIG. 4, the original image I is input, and the following processesare performed: firstly, a hair region image P_(h) is acquired via atrained deep neural network; secondly, an occluded face region imageP_(o) is acquired via a trained deep neural network; thirdly, a skinregion image P_(s) is acquired via a trained deep neural network;fourthly, spatial coordinate information of a face is acquired via atrained deep neural network, which includes facial key point informationK_(f) and facial posture information K_(pose); fifthly, a faceorientation mask map m_(faceD) is acquired based on the facial postureinformation K_(pose), the distance l between each pixel to a facemidline is calculated, and a posture weight image P_(f) is generatedaccording to a formula P_(f)=α−β·l·m_(faceD); sixthly, a face area A_(f)is calculated based on the facial key point information K_(f), and anaverage brightness parameter L_(f) of the face region is acquired;seventhly, a smoothed posture weight image and a smoothed skin toneimage are acquired by feathering (namely, smoothing) the posture weightimage P_(f) and the skin region image P_(s) via a two-dimensionalGaussian blur function; eighthly, a rendered target texture materialT_(s) is acquired via hierarchical rendering which means that differentskin texture materials are selected depending on different face areasA_(f); ninthly, a facial texture image I_(t) is acquired bysuperimposing the target texture material T_(s) onto the original imageI in a linear light superposition mode, wherein I_(t)=I+2.0×T_(s)−1.0;and tenthly, a final facial texture superimposing result (namely, thesecond image) is acquired based on the images acquired in the aboveprocesses of first, second, six, seven, and nine, and the originalimage.

In the above process, after skin grinding is performed on the face skin,corresponding facial texture details can be added, via a pre-stored skintexture material, to an image whose texture is lost after the skingrinding. Therefore, after skin grinding and blemish removal, the facecan still contain textures, which makes the skin grinding effect morenatural and real, and avoids increasing image noise due to the USMsharpening algorithm. In some embodiments, a deep neural network is alsoused to automatically generate relatively real and natural skin texturesin an end-to-end fashion. In addition, facial status under differentpostures and brightness is considered more properly by introducing thefacial posture information and the average brightness parameter, suchthat the texture superimposing effect is more natural and unobtrusive.In addition, the face region can be divided more finely via the deepneural network, thereby ensuring that non-face regions are not affected.

In the method provided by the embodiment of the present disclosure,after smoothing the skin region of the target object in the originalimage, the skin texture material whose scale matches the face area isselected to generate the facial texture image that changes depending ona facial posture of the target object. The facial texture image issuperimposed on the smoothed first image, such that the finally acquiredsecond image has a better face skin grinding effect, and more facialtexture details are restored, thereby improving the image processingaccuracy and the image processing effect.

FIG. 5 is a logical structural block diagram of an apparatus forprocessing images according to an embodiment. Referring to FIG. 5, theapparatus includes a smoothing unit 501, a determining unit 502, arendering unit 503, and a fusing unit 504.

The smoothing unit 501 is configured to acquire a first image bysmoothing a skin region of a target object in an original image.

The determining unit 502 is configured to determine a skin texturematerial matching with a face area of the target object.

The rendering unit 503 is configured to acquire a facial texture imageof the target object by rendering the skin texture material, whereinboth facial key point information and facial posture information of thefacial texture image are matched with the target object.

The fusing unit 504 is configured to acquire a second image by fusingthe facial texture image with the first image.

In the apparatus provided by the embodiment of the present disclosure,after smoothing the skin region of the target object in the originalimage, the skin texture material whose scale matches the face area isselected to generate the facial texture image that changes depending ona facial posture of the target object. The facial texture image issuperimposed on the smoothed first image, such that the finally acquiredsecond image has a better face skin grinding effect, and more facialtexture details are restored, thereby improving the image processingaccuracy and the image processing effect.

In some embodiments, the determining unit 502 is configured todetermine, based on a face area range within which the face area is, aresolution range matching with the face area range, wherein a medianvalue of the face area range is positively correlated with a medianvalue of the resolution range; and acquire the skin texture materialwhose resolution is within the resolution range.

In some embodiments, based on the composition of the apparatus shown inFIG. 5, the rendering unit 503 includes a first acquiring subunit, arendering subunit, and a fusing subunit. The first acquiring subunit isconfigured to acquire the facial key point information and the facialposture information of the target object, wherein the facial postureinformation of the target object is configured to indicate a facerotation condition of the target object. The rendering subunit isconfigured to acquire a target texture material by rendering the skintexture material based on the facial key point information and thefacial posture information of the target object. The fusing subunit isconfigured to acquire the facial texture image by fusing the targettexture material with the original image.

In some embodiments, the rendering subunit is configured to acquirestandard key point information of the skin texture material; determine,based on the facial key point information of the target object and thestandard key point information, a correspondence relationship betweenstandard key points of the skin texture material and facial key pointsof the target object; and acquire the target texture material byperforming texture mapping on the skin texture material based on thecorrespondence relationship and the facial posture information.

In some embodiments, based on the composition of the apparatus shown inFIG. 5, the smoothing unit 501 includes a second acquiring subunit, athird acquiring subunit, and a smoothing subunit. The second acquiringsubunit is configured to acquire the facial key point information andthe facial posture information of the target object, wherein the facialposture information of the target object is configured to indicate aface rotation condition of the target object. The third acquiringsubunit is configured to acquire a posture weight image of the targetobject based on the facial posture information of the target object,wherein the pixel value of each pixel in the posture weight image isconfigured to indicate a posture weight parameter of a correspondingpixel in the original image, the posture weight parameter beingconfigured to indicate an importance of the corresponding pixel relativeto the facial posture information. The smoothing subunit is configuredto acquire the first image by smoothing the skin region based on theposture weight image.

In some embodiments, the facial posture information includes an Eulerangle of the facial posture of the target object, and the thirdacquiring subunit includes a first acquiring sub-subunit, a secondacquiring sub-subunit, and a third acquiring sub-subunit. The firstacquiring sub-subunit is configured to acquire a face orientation maskmap of the target object based on a value symbol of the Euler angle ofthe facial posture, wherein the face orientation mask map is configuredto indicate whether an orientation of a face of the target object isforward or backward. The second acquiring sub-subunit is configured toacquire a distance from each pixel in a face region of the target objectto a face midline. The third acquiring sub-subunit is configured toacquire the posture weight image based on the face orientation mask mapand the distance.

In a possible embodiment, the third acquiring sub-subunit is configuredto acquire a first value by multiplying the distance for each pixel inthe face region of the target object by a pixel value of a correspondingpixel in the face orientation mask map; acquire a second value bymultiplying the first value by a first coefficient, wherein the firstcoefficient is an adjustment factor for a distance from a pixel to aface midline, and is greater than or equal to 0 and less than or equalto 1; and acquire the pixel value of a corresponding pixel in theposture weight image by calculating a difference between a secondcoefficient and the second value, wherein the second coefficient isequal to 1.

In some embodiments, the smoothing subunit is configured to acquire askin region image of the original image, wherein the skin region imageis configured to indicate the skin region of the target object in theoriginal image; acquire a smoothed skin tone image and a smoothedposture weight image by smoothing the skin region image and the postureweight image based on a two-dimensional Gaussian blur function; andacquire the first image by fusing the original image with the smoothedskin tone image and the smoothed posture weight image.

In some embodiments, based on the composition of the apparatus shown inFIG. 5, the apparatus further includes an acquiring unit. The acquiringunit is configured to a hair region image and an occluded face regionimage of the original image, and an average brightness parameter of theface region of the target object in the original image, wherein the hairregion image is configured to indicate a hair region of the targetobject in the original image, and the occluded face region image isconfigured to indicate an occluded face region of the target object inthe original image. The fusing unit 504 includes a fourth acquiringsubunit. The fourth acquiring subunit is configured to acquire thesecond image based on the hair region image, the occluded face regionimage, the first image, the facial texture image, and the averagebrightness parameter.

In some embodiments, the fourth acquiring subunit is configured toacquire a third image by multiplying the pixel value of a pixel in thehair region image by the pixel values of pixels at correspondingpositions in the occluded face region image, the first image, and thefacial texture image; and acquire the second image by multiplying thepixel value of each pixel in the third image by the average brightnessparameter.

Taking that an electronic device is a terminal as an example fordescription, FIG. 6 is a structural block diagram of a terminalaccording to an embodiment of the present disclosure. The terminal 600may be a smart phone, a tablet computer, a Moving Picture Experts GroupAudio Layer III (MP3) player, a Moving Picture Experts Group Audio LayerIV (MP4) player, a laptop, or a desktop computer. The terminal 600 mayalso be called user equipment (UE), a portable terminal, a laptopterminal, a desktop terminal, or the like.

Usually, the terminal 600 includes one or more processors 601 and one ormore memories 602.

The processor 601 may include one or more processing cores, such as a4-core processor or an 8-core processor. The processor 601 may beimplemented by at least one hardware of a digital signal processing(DSP), a field-programmable gate array (FPGA), and a programmable logicarray (PLA). The processor 601 may also include a main processor and acoprocessor. The main processor is a processor configured to process thedata in an awake state, and is also called a central processing unit(CPU). The coprocessor is a low-power-consumption processor configuredto process the data in a standby state. In some embodiments, theprocessor 601 may be integrated with a graphics processing unit (GPU),which is configured to render and draw the content that needs to bedisplayed by a display screen. In some embodiments, the processor 601may also include an artificial intelligence (AI) processor configured toprocess computational operations related to machine learning.

The memory 602 may include one or more computer-readable storagemediums, which may be non-transitory. The memory 602 may also include ahigh-speed random access memory, as well as a non-volatile memory, suchas one or more magnetic disk storage devices and flash storage devices.In some embodiments, the non-transitory computer-readable storage mediumin the memory 602 is configured to store one or more instructionstherein, wherein the one or more instructions, when loaded and executedby the processor 601, cause the processor to perform the method forprocessing images as defined in the embodiments of the presentdisclosure.

In some embodiments, the terminal 600 may also include a peripheraldevice interface 603 and at least one peripheral device. The processor601, the memory 602, and the peripheral device interface 603 may beconnected via a bus or a signal line. Each peripheral device may beconnected to the peripheral device interface 603 via a bus, a signalline, or a circuit board. Specifically, the peripheral device includesat least one of a radio frequency circuit 604, a touch display screen605, a camera component 606, an audio circuit 607, a positioningcomponent 608, and a power source 609.

The peripheral device interface 603 may be configured to connect atleast one peripheral device associated with an input/output (I/O) to theprocessor 601 and the memory 602. In some embodiments, the processor601, the memory 602, and the peripheral device interface 603 areintegrated on the same chip or circuit board. In some other embodiments,any one or two of the processor 601, the memory 602, and the peripheraldevice interface 603 may be implemented on a separate chip or circuitboard, which is not limited in the present disclosure.

The radio frequency circuit 604 is configured to receive and transmit aradio frequency (RF) signal, which is also referred to as anelectromagnetic signal. The radio frequency circuit 604 communicateswith a communication network and other communication devices via theelectromagnetic signal. The radio frequency circuit 604 converts theelectrical signal into the electromagnetic signal for transmission orconverts the received electromagnetic signal into the electrical signal.Optionally, the radio frequency circuit 604 includes an antenna system,an RF transceiver, one or more amplifiers, a tuner, an oscillator, adigital signal processor, a codec chipset, a subscriber identity modulecard, and the like. The radio frequency circuit 604 may communicate withother terminals via at least one wireless communication protocol. Thewireless communication protocol includes, but is not limited to, ametropolitan area network, various generations of mobile communicationnetworks (2G, 3G, 4G, and 5G), a wireless local area network, and/or awireless fidelity (Wi-Fi) network. In some embodiments, the radiofrequency circuit 604 may also include near field communication (NFC)related circuits, which is not limited in the present disclosure.

The display screen 605 is configured to display a user interface (UI).The UI may include graphics, text, icons, videos, and any combinationthereof. In the case that the display screen 605 is a touch displayscreen, the display screen 605 also can acquire touch signals on or overthe surface of the display screen 605. The touch signal may be inputinto the processor 601 as a control signal for processing. In this case,the display screen 605 may also be configured to provide virtual buttonsand/or virtual keyboards, which are also referred to as soft buttonsand/or soft keyboards. In some embodiments, one display screen 605 maybe disposed on the front panel of the terminal 600. In some otherembodiments, at least two display screens 605 may be disposedrespectively on different surfaces of the terminal 600 or in a foldeddesign. In some embodiments, the display screen 605 may be a flexibledisplay screen disposed on a bending or a folded surface of the terminal600. Moreover, the display screen 605 may be defined to an irregularshape other than a rectangle, that is, the display screen 605 may be anirregular-shaped screen. The display screen 605 may be a light crystaldisplay (LCD) screen, an organic light-emitting diode (OLED) displayscreen, or the like.

The camera component 606 is configured to capture images or videos.Optionally, the camera component 606 includes a front camera and a rearcamera. Usually, the front camera is disposed on the front panel of theterminal, and the rear camera is disposed on the back surface of theterminal. In some embodiments, at least two rear cameras are disposed,and each of the at least two rear cameras is at least one of a maincamera, a depth-of-field camera, a wide-angle camera, and a telephotocamera, to achieve a background blurring function achieved by fusion ofthe main camera and the depth-of-field camera, panoramic shooting andvirtual reality (VR) shooting functions by fusion of the main camera andthe wide-angle camera, or other fusion shooting functions. In someembodiments, the camera component 606 may further include a flashlight.The flashlight may be a mono-color-temperature flashlight or atwo-color-temperature flashlight. The two-color-temperature flashlightis a combination of a warm flashlight and a cold flashlight and may beused for light compensation at different color temperatures.

The audio circuit 607 may include a microphone and a speaker. Themicrophone is configured to acquire sound waves of users andenvironments, and convert the sound waves into electrical signals whichare input into the processor 601 for processing, or input into the radiofrequency circuit 604 for voice communication. For stereo acquisition ornoise reduction, there may be a plurality of microphones respectivelydisposed at different positions of the terminal 600. The microphone mayalso be an array microphone or an omnidirectional acquisitionmicrophone. The speaker is then configured to convert the electricalsignals from the processor 601 or the radio frequency circuit 604 intothe sound waves. The speaker may be a conventional film speaker or apiezoelectric ceramic speaker. In the case that the speaker is thepiezoelectric ceramic speaker, the electrical signal may be convertedinto not only human-audible sound waves but also the sound waves whichare inaudible to humans for ranging and the like. In some embodiments,the audio circuit 607 may also include a headphone jack.

The positioning component 608 is configured to position the currentgeographic location of the terminal 600 to implement navigation or alocation-based service (LBS). The positioning component 608 may beUnited States' Global Positioning System (GPS), China's BeiDouNavigation Satellite System (BDS), Russia's Global Navigation SatelliteSystem (GLONASS), or the European Union's Galileo Satellite NavigationSystem (Galileo).

The power source 609 is configured to power up various components in theterminal 600. The power source 609 may be alternating current, directcurrent, a disposable battery, or a rechargeable battery. In the casethat the power source 609 includes the rechargeable battery, therechargeable battery may support wired or wireless charging. Therechargeable battery may also support the fast charging technology.

In some embodiments, the terminal 600 also includes one or more sensors610. The one or more sensors 610 include, but are not limited to, anacceleration sensor 611, a gyro sensor 612, a pressure sensor 613, afingerprint sensor 614, an optical sensor 615, and a proximity sensor616.

The acceleration sensor 611 may detect magnitudes of accelerations onthree coordinate axes of a coordinate system established by the terminal600. For example, the acceleration sensor 611 may be configured todetect components of a gravitational acceleration on the threecoordinate axes. The processor 601 may control the touch display screen605 to display a user interface in a transverse view or a longitudinalview based on a gravity acceleration signal acquired by the accelerationsensor 611. The acceleration sensor 611 may also be configured toacquire motion data of a game or a user.

The gyro sensor 612 can detect a body direction and a rotation angle ofthe terminal 600, and can cooperate with the acceleration sensor 611 toacquire a 3D motion of the user to the terminal 600. Based on the dataacquired by the gyro sensor 612, the processor 601 can achieve thefollowing functions: motion sensing (such as changing the UI accordingto a user's tilt operation), image stabilization during shooting, gamecontrol, and inertial navigation.

The pressure sensor 613 may be disposed on a side frame of the terminal600 and/or a lower layer of the touch display screen 605. In the casethat the pressure sensor 613 is disposed on the side frame of theterminal 600, a user's holding signal to the terminal 600 can bedetected. The processor 601 can perform left-right hand recognition orquick operation according to the holding signal acquired by the pressuresensor 613. In the case that the pressure sensor 613 is disposed on thelower layer of the touch display screen 605, the processor 601 controlsan operable control on the UI according to a user's press operation onthe touch display screen 605. The operable control includes at least oneof a button control, a scroll bar control, an icon control, and a menucontrol.

The fingerprint sensor 614 is configured to acquire a user'sfingerprint. The processor 601 identifies the user's identity based onthe fingerprint acquired by the fingerprint sensor 614, or thefingerprint sensor 614 identifies the user's identity based on theacquired fingerprint. In the case that the user's identity is identifiedas trusted, the processor 601 authorizes the user to perform relatedsensitive operations, such as unlocking the screen, viewing encryptedinformation, downloading software, paying, and changing settings. Thefingerprint sensor 614 may be disposed on the front, the back, or theside of the terminal 600. In the case that the terminal 600 is providedwith a physical button or a manufacturer's logo, the fingerprint sensor614 may be integrated with the physical button or the manufacturer'slogo.

The optical sensor 615 is configured to acquire ambient light intensity.In one embodiment, the processor 601 may control the display brightnessof the touch display screen 605 based on the ambient light intensityacquired by the optical sensor 615. In some embodiments, in the casethat the ambient light intensity is high, the display brightness of thetouch display screen 605 is increased; and in the case that the ambientlight intensity is low, the display brightness of the touch displayscreen 605 is decreased. In some embodiments, the processor 601 may alsodynamically adjust shooting parameters of the camera component 606according to the ambient light intensity acquired by the optical sensor615.

The proximity sensor 616, also referred to as a distance sensor, isusually disposed on the front panel of the terminal 600. The proximitysensor 616 is configured to acquire a distance between the user and thefront surface of the terminal 600. In some embodiments, in the case thatthe proximity sensor 616 detects that the distance between the user andthe front surface of the terminal 600 gradually decreases, the processor601 controls the touch display screen 605 to switch from a screen-onstate to a screen-off state. In the case that the proximity sensor 616detects that the distance between the user and the front surface of theterminal 600 gradually increases, the processor 601 controls the touchdisplay screen 605 to switch from the screen-off state to the screen-onstate.

Those skilled in the art may understand that the structure shown in FIG.6 does not constitute a limitation to the terminal 600. The terminal 600may include more or fewer components than those shown in the figure, orcombine some components or adopt different component arrangements.

FIG. 7 is a schematic structural diagram of an electronic deviceaccording to an embodiment of the present disclosure. Significantdifferences may be formed depending on different configurations orperformances of the electronic device 700. The electronic device 700 mayinclude one or more processors (CPUs) 701 and one or more memories 702.The one or more memories 702 are configured to store one or moreinstructions. The one or more instructions, when loaded and executed bythe one or more processors 701, cause the one or more processors toperform the method for processing images provided by the aboveembodiments. Of course, the electronic device 700 may further includecomponents such as a wired or wireless network interface, a keyboard,and an input/output interface for input and output. The electronicdevice 700 may further include other components for implementing devicefunctions, which is not repeated herein.

In some embodiments, a storage medium is provided. The storage mediumstores one or more instructions, such as a memory storing one or moreinstructions. The one or more instructions, when loaded and executed bythe processor in the electronic device, cause the electronic device toperform the method for processing images provided by the aboveembodiments. Optionally, the above storage medium may be a non-temporarycomputer-readable storage medium. For example, the non-temporarycomputer-readable storage medium may include a read-only memory (ROM), arandom-access memory (RAM), a compact disc read-only memory (CD-ROM), amagnetic tape, a floppy disc, an optical data storage device, or thelike.

In some embodiments, a computer program product is provided. Thecomputer program product stores one or more instructions therein. Theone or more instructions, when loaded and executed by the processor inthe electronic device, cause the electronic device to perform the methodfor processing images provided by the above embodiments.

What is claimed is:
 1. A method for processing images, comprising:acquiring a first image by smoothing a skin region of a target object inan original image; determining a skin texture material matching with aface area of the target object, wherein the skin texture material isselected from pre-stored candidate skin texture materials, wherein thepre-stored candidate skin materials are texture materials for standardskin of a face of a character drawn by a technician; acquiring a facialtexture image of the target object by rendering the skin texturematerial, wherein both facial key point information and facial postureinformation of the facial texture image are matched with the targetobject; and acquiring a second image by fusing the facial texture imagewith the first image.
 2. The method according to claim 1, wherein saiddetermining the skin texture material matching with the face area of thetarget object comprises: determining, based on a face area range withinwhich the face area is, a resolution range matching with the face arearange, wherein a median value of the face area range is positivelycorrelated with a median value of the resolution range; and acquiringthe skin texture material whose resolution is within the resolutionrange.
 3. The method according to claim 1, wherein said acquiring thefacial texture image of the target object by rendering the skin texturematerial comprises: acquiring facial key point information and facialposture information of the target object, wherein the facial postureinformation of the target object is configured to indicate a facerotation condition of the target object; acquiring a target texturematerial by rendering the skin texture material based on the facial keypoint information and the facial posture information of the targetobject; and acquiring the facial texture image by fusing the targettexture material with the original image.
 4. The method according toclaim 3, wherein said acquiring the target texture material by renderingthe skin texture material based on the facial key point information andthe facial posture information of the target object comprises: acquiringstandard key point information of the skin texture material;determining, based on the facial key point information of the targetobject and the standard key point information, a correspondencerelationship between standard key points of the skin texture materialand facial key points of the target object; and acquiring the targettexture material by performing texture mapping on the skin texturematerial based on the correspondence relationship and the facial postureinformation of the target object.
 5. The method according to claim 1,wherein said acquiring the first image by smoothing the skin region ofthe target object in the original image comprises: acquiring facial keypoint information and facial posture information of the target object,wherein the facial posture information of the target object isconfigured to indicate a face rotation condition of the target object;acquiring a posture weight image of the target object based on thefacial posture information of the target object, wherein a pixel valueof each pixel in the posture weight image is configured to indicate aposture weight parameter of a corresponding pixel in the original image,the posture weight parameter being configured to indicate an importanceof the corresponding pixel relative to the facial posture information;and acquiring the first image by smoothing the skin region based on theposture weight image.
 6. The method according to claim 5, wherein thefacial posture information of the target object comprises an Euler angleof a facial posture of the target object, and said acquiring the postureweight image of the target object based on the facial postureinformation of the target object comprises: acquiring a face orientationmask map of the target object based on a value symbol of the Euler angleof the facial posture, wherein the face orientation mask map isconfigured to indicate whether an orientation of a face of the targetobject is forward or backward; acquiring a distance from each pixel in aface region of the target object to a face midline; and acquiring theposture weight image based on the face orientation mask map and thedistance.
 7. The method according to claim 6, wherein said acquiring theposture weight image based on the face orientation mask map and thedistance comprises: acquiring a first value by multiplying the distancefor each pixel in the face region of the target object by a pixel valueof a corresponding pixel in the face orientation mask map; acquiring asecond value by multiplying the first value by a first coefficient,wherein the first coefficient is an adjustment factor for a distancefrom a pixel to a face midline, and is greater than or equal to 0 andless than or equal to 1; and acquiring a pixel value of a correspondingpixel in the posture weight image by calculating a difference between asecond coefficient and the second value, wherein the second coefficientis equal to
 1. 8. The method according to claim 5, wherein saidacquiring the first image by smoothing the skin region based on theposture weight image comprises: acquiring a skin region image of theoriginal image, wherein the skin region image is configured to indicatethe skin region of the target object in the original image; acquiring asmoothed skin tone image and a smoothed posture weight image bysmoothing the skin region image and the posture weight image based on atwo-dimensional Gaussian blur function; and acquiring the first image byfusing the original image, the smoothed skin tone image, and thesmoothed posture weight image.
 9. The method according to claim 1,further comprising: acquiring a hair region image and an occluded faceregion image of the original image, and an average brightness parameterof a face region of the target object in the original image, wherein thehair region image is configured to indicate a hair region of the targetobject in the original image, and the occluded face region image isconfigured to indicate an occluded face region of the target object inthe original image; and acquiring the second image by fusing the facialtexture image with the first image comprises: acquiring the second imagebased on the hair region image, the occluded face region image, thefirst image, the facial texture image, and the average brightnessparameter.
 10. The method according to claim 9, wherein said acquiringthe second image based on the hair region image, the occluded faceregion image, the first image, the facial texture image, and the averagebrightness parameter comprises: acquiring a third image by multiplying apixel value of a pixel in the hair region image by pixel values ofpixels at corresponding positions in the occluded face region image, thefirst image, and the facial texture image; and acquiring the secondimage by multiplying a pixel value of each pixel in the third image bythe average brightness parameter.
 11. An electronic device, comprising:one or more processors; and one or more memories configured to store oneor more instructions executable by the one or more processors; whereinthe one or more processors, when loading and executing the one or moreinstructions, are caused to perform the following processes: acquiring afirst image by smoothing a skin region of a target object in an originalimage; determining a skin texture material matching with a face area ofthe target object; acquiring a facial texture image of the target objectby rendering the skin texture material, wherein both facial key pointinformation and facial posture information of the facial texture imageare matched with the target object; and acquiring a second image byfusing the facial texture image with the first image, wherein saidacquiring the first image by smoothing the skin region of the targetobject in the original image comprises: acquiring facial key pointinformation and facial posture information of the target object, whereinthe facial posture information of the target object is configured toindicate a face rotation condition of the target object; acquiring aposture weight image of the target object based on the facial postureinformation of the target object, wherein a pixel value of each pixel inthe posture weight image is configured to indicate a posture weightparameter of a corresponding pixel in the original image, the postureweight parameter being configured to indicate an importance of thecorresponding pixel relative to the facial posture information; andacquiring the first image by smoothing the skin region based on theposture weight image.
 12. The electronic device according to claim 11,wherein the one or more processors, when loading and executing the oneor more instructions, are caused to further perform the followingprocesses: determining, based on a face area range within which the facearea is, a resolution range matching with the face area range, wherein amedian value of the face area range is positively correlated with amedian value of the resolution range; and acquiring the skin texturematerial whose resolution is within the resolution range.
 13. Theelectronic device according to claim 11, wherein the one or moreprocessors, when loading and executing the one or more instructions, arecaused to further perform the following processes: acquiring facial keypoint information and facial posture information of the target object,wherein the facial posture information of the target object isconfigured to indicate a face rotation condition of the target object;acquiring a target texture material by rendering the skin texturematerial based on the facial key point information and the facialposture information of the target object; and acquiring the facialtexture image by fusing the target texture material with the originalimage.
 14. The electronic device according to claim 13, wherein the oneor more processors, when loading and executing the one or moreinstructions, are caused to further perform the following processes:acquiring standard key point information of the skin texture material;determining, based on the facial key point information of the targetobject and the standard key point information, a correspondencerelationship between standard key points of the skin texture materialand facial key points of the target object; and acquiring the targettexture material by performing texture mapping on the skin texturematerial based on the correspondence relationship and the facial postureinformation of the target object.
 15. The electronic device according toclaim 11, wherein the one or more processors, when loading and executingthe one or more instructions, are caused to further perform thefollowing processes: acquiring a face orientation mask map of the targetobject based on a value symbol of an Euler angle of a facial posture,wherein the face orientation mask map is configured to indicate whetheran orientation of a face of the target object is forward or backward;acquiring a distance from each pixel in a face region of the targetobject to a face midline; and acquiring the posture weight image basedon the face orientation mask map and the distance.
 16. The electronicdevice according to claim 15, wherein the one or more processors, whenloading and executing the one or more instructions, are caused tofurther perform the following processes: acquiring a first value bymultiplying the distance for each pixel in the face region of the targetobject by a pixel value of a corresponding pixel in the face orientationmask map; acquiring a second value by multiplying the first value by afirst coefficient, wherein the first coefficient is an adjustment factorfor a distance from a pixel to a face midline, and is greater than orequal to 0 and less than or equal to 1; and acquiring a pixel value of acorresponding pixel in the posture weight image by calculating adifference between a second coefficient and the second value, whereinthe second coefficient is equal to
 1. 17. The electronic deviceaccording to claim 11, wherein the one or more processors, when loadingand executing the one or more instructions, are caused to furtherperform the following processes: acquiring a skin region image of theoriginal image, wherein the skin region image is configured to indicatethe skin region of the target object in the original image; acquiring asmoothed skin tone image and a smoothed posture weight image bysmoothing the skin region image and the posture weight image based on atwo-dimensional Gaussian blur function; and acquiring the first image byfusing the original image, the smoothed skin tone image, and thesmoothed posture weight image.
 18. The electronic device according toclaim 11, wherein the one or more processors, when loading and executingthe one or more instructions, are caused to further perform thefollowing processes: acquiring a hair region image and an occluded faceregion image of the original image, and an average brightness parameterof a face region of the target object in the original image, wherein thehair region image is configured to indicate a hair region of the targetobject in the original image, and the occluded face region image isconfigured to indicate an occluded face region of the target object inthe original image; and acquiring the second image based on the hairregion image, the occluded face region image, the first image, thefacial texture image, and the average brightness parameter.
 19. Anon-transitory computer-readable storage medium storing one or moreinstructions therein, wherein the one or more instructions, when loadedand executed by one or more processors of an electronic device, causethe electronic device to perform the following processes: acquiring afirst image by smoothing a skin region of a target object in an originalimage; determining a skin texture material matching with a face area ofthe target object, wherein the skin texture material is selected frompre-stored candidate skin texture materials, wherein the pre-storedcandidate skin materials are texture materials for standard skin of aface of a character drawn by a technician; acquiring a facial textureimage of the target object by rendering the skin texture material,wherein both facial key point information and facial posture informationof the facial texture image are matched with the target object; andacquiring a second image by fusing the facial texture image with thefirst image.